import { createApp } from 'vue'
// 进度条样式
import 'nprogress/nprogress.css'
import App from './App.vue'

// 引入ElementPlus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/dark/css-vars.css'
//@ts-expect-error ts忽略zh-cn.mjs的类型检测
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'

import '@/styles/index.scss'

// 引入svg图标注册器
import 'virtual:svg-icons-register'

// 引入全局组件
import globalComponent from '@/components/index'

// 引入路由
import router from '@/router'
import '@/router/permission.ts'

// 引入pinia
import pinia from '@/store'
import { isHasButton } from '@/directive/has.ts'

const app = createApp(App)

// 注册ElementPlus
app.use(ElementPlus, {
  locale: zhCn,
})
// 注册全局组件
app.use(globalComponent)

// 注册路由
app.use(router)

// 注册pinia
app.use(pinia)

isHasButton(app)
// 挂载app
app.mount('#app')
